package com.stormrage.edu.dao.edu.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.stormrage.edu.dao.edu.EduProjectDao;
import com.stormrage.entity.edu.EduProject;
import com.stormragetech.core.dao.MysBaseDao;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: EduProjectDaoImpl.java
 * @Package com.stormrage.edu.dao.edu.impl
 * @Description: 项目 Dao
 * @author www.stormragetech.com
 * @date 2016年4月16日
 * @version V1.0
 */
@Repository
public class EduProjectDaoImpl extends MysBaseDao implements EduProjectDao {

	private static final Logger logger = LoggerFactory.getLogger(EduProjectDaoImpl.class);

	@Override
	public EduProject queryById(Map<String, Object> map) throws StormrageTechException {

		logger.debug(" 【 Dao 】-【 EduProjectDao 】-【 QueryById 】-【 STARTED 】");

		final String query = "SELECT * FROM edu_project WHERE id = :id";
		logger.debug(" 数据库执行语句为 " + query);

		EduProject entity = queryObject(query, EduProject.class, map);

		logger.debug(" 【 Dao 】-【 EduProjectDao 】-【 QueryById 】-【 COMPLETED 】");
		return entity;
		
	}

	@Override
	public List<EduProject> queryList() throws StormrageTechException {

		logger.debug(" 【 Dao 】-【 EduProjectDao 】-【 QueryList 】-【 STARTED 】");

		final String query = "SELECT * FROM edu_project";
		logger.debug(" 数据库执行语句为 " + query);

		List<EduProject> array = queryList(query, EduProject.class);

		logger.debug(" 【 Dao 】-【 EduProjectDao 】-【 QueryList 】-【 COMPLETED 】");
		return array;
		
	}

}
